Repository navigation
Conversation
- Send every queued batch in one process call; treat any 2xx as sent. - Load persisted events once, oldest first, without duplicating events already queued; drop unreadable entries and apply maxItems. - Skip persisted events another tab already sent and removed, and give queue keys a random suffix so tabs can't overwrite each other. - Back off 5 minutes by default (matches the .NET client). The old quarter-hour math produced no delay at :00/:15/:30/:45, which also made a 402 discard nothing. - Respect the suspension window in process(), not only on the timer. - Retry 413 batches smaller without permanently shrinking submissionBatchSize. - Abort requests after 30 seconds so a hung connection can't stall the queue, use keepalive for small submissions so they survive page unload, and tolerate non-JSON response bodies. - Fetch settings from configServerUrl and URL-encode heartbeat ids.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d955dc961
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
🟡 Changes recommended
Critical queue-handling defects can permanently lose events by marking writes persisted before they succeed and deleting potentially valid entries after transient storage read failures.
2 open issues
What changed in this PR
Improves queued-event delivery in the shared core used by Exceptionless SDKs.
Changes:
- Updates persisted-event loading, batch draining, retries, and backoff.
- Adds request timeouts, browser keepalive handling, and endpoint corrections.
- Adds regression tests and documents delivery behavior.
| File | Description |
|---|---|
packages/core/test/submission/TestSubmissionClient.test.ts |
Updates settings-endpoint expectations. |
packages/core/test/submission/DefaultSubmissionClient.test.ts |
Tests request routing, timeouts, response parsing, and keepalive. |
packages/core/test/queue/DefaultEventQueue.test.ts |
Adds persistence, batching, and retry regression coverage. |
packages/core/src/submission/DefaultSubmissionClient.ts |
Updates request reliability, settings routing, and heartbeat encoding. |
packages/core/src/queue/DefaultEventQueue.ts |
Revises persisted loading, batch processing, and suspension behavior. |
.agents/skills/exceptionless-javascript/references/troubleshooting.md |
Documents flushing, retry pauses, and unload delivery. |
Review effort: Balanced
- Mark an entry persisted only after its write succeeds, and wait for a pending write before sending, so a failed or in-flight write isn't mistaken for an event another tab already sent. - Keep entries that couldn't be read for a later session; only remove entries whose JSON is malformed. - Stop sending further batches once the client is disabled.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 405003a683
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- localStorage throws synchronously when its quota is full, which rejected enqueue() before the event was queued. Synchronous throws are now handled like rejections and the event is sent from memory. - process() returns the run that is already sending instead of resolving immediately, so callers like suspend() and flush() wait for in-flight submissions.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d265071fcb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The handler runs inside the processing run, so waiting for that run from the handler never finished.
| }); | ||
|
|
||
| test("waits for a pending write before sending the event", async () => { | ||
| const storage = new InMemoryStorage(); |
There was a problem hiding this comment.
we need to update agent rules but nice to have // Arrange, Act, Assert comments here too across the codebase.
| vi.spyOn(storage, "setItem").mockImplementationOnce( | ||
| (key, value) => | ||
| new Promise((resolve) => { | ||
| finishWrite = () => void setItem(key, value).then(resolve); |
There was a problem hiding this comment.
I really hate seeing void and .then callback stuff for modern js
niemyjski
left a comment
There was a problem hiding this comment.
[AGENT] I reproduced two queue concurrency cases on this head with synthetic events.

Fixes queue and submission bugs that lost, duplicated, or stalled events.
process()were loaded again from storage and sent twice (React Native always persists)maxItemslocalStoragesent each other's queued eventsprocess()called directly (tab hide, startup,processQueue()) ignored backoffconfig.submissionBatchSizekeepalivefor bodies inside the browser's 64 KiB budgetserverUrl, soconfigServerUrldid nothingconfigServerUrl(as the .NET client does;serverUrlstill sets it)No public API changes. Behavior changes are the bug fixes above. Users who set only
configServerUrlwill now get settings from it.Checks: new tests for each row (17 queue tests fail on
main, pass here) plus a newDefaultSubmissionClientsuite.npm test(370),npm run lint, core build, and type-checks for browser, node and react-native pass. Two existing tests that expected settings fromserverUrlwere updated.